package com.tmxk.springmvc.service.impl;

import com.tmxk.springmvc.dao.TUserinfoMapper;
import com.tmxk.springmvc.pojo.TUserinfo;
import com.tmxk.springmvc.service.TUserinfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("tUserinfoServiceImpl")
public class TUserinfoServiceImpl implements TUserinfoService {
    //基于@Resource注解,将数据访问层和业务访问层关联上
    @Resource
    private TUserinfoMapper tUserinfoMapper;

    @Override
    public List<TUserinfo> queryTUserinfoByInfo(TUserinfo userinfo) {
        return tUserinfoMapper.queryTUserinfoByInfo(userinfo);
    }

    @Override
    public boolean insertTUserinfo(TUserinfo tUserinfo) {
        return tUserinfoMapper.insertTUserinfo(tUserinfo) > 0 ? true : false;
    }

    @Override
    public boolean updateTUserinfoById(TUserinfo tUserinfo) {
        return tUserinfoMapper.updateTUserinfoById(tUserinfo) > 0 ? true : false;
    }

    @Override
    public boolean deleteTUserinfoById(Integer id) {
        return tUserinfoMapper.deleteTUserinfoById(id) > 0 ? true : false;
    }

    @Override
    public int calcCount(TUserinfo requestParam) {
        return tUserinfoMapper.calcCount(requestParam);
    }

}
